<% announcements.each_with_index do |announcement, index| %>
  <div class="cellRow cellRow<%= index % 2 + 1 %>">
    <div class="cellBlock cellBlockNoBorderL" style="border: none">
      <span class="announcementDate">
        <%=h (Time.now.day == announcement.created_at.day and
              Time.now.month == announcement.created_at.month) ?
                announcement.created_at.strftime("%I:%M %p") :
                announcement.created_at.strftime("%b %d") %>
      </span>
      <%= link_to h(announcement.member.full_name),
        :controller => "members", :action => "show", :id => announcement.member.id %>:
      <%=h announcement.message %>
        <% if session[:user].admin? or session[:user].id == announcement.member.id %>
          <div class="announcementDelete">
            <%= link_to_function "x",
                "if (confirm('Are you sure you want to delete this post?')) window.location = 'delete_post?id=#{announcement.id}'" %>
          </div>
        <% end %>
    </div>
  </div>
<% end %>&nbsp;
